package com.dragee.modules.work.demo;

import com.dragee.common.R;
import com.dragee.modules.work.service.ExcelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author tys on 2023/5/6
 */
@RestController
@RequestMapping("excel")
@Api(tags = "Z - 测试导入导出")
public class ExcelController {
    @Autowired
    public ExcelService excelService;

    @ApiOperation(value = "测试导入")
    @PostMapping("/importDemo")
    public R importData(@RequestParam("file") MultipartFile file) throws IOException {
        excelService.importDemo(file);
        return R.ok();
    }

}
